﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;

namespace Kaleidoscope
{
    public partial class DynamicImage : System.Web.UI.UserControl
    {
        private System.Web.UI.WebControls.Image imageControl = new System.Web.UI.WebControls.Image();
        protected void Page_Load(object sender, EventArgs e)
        {            
            imageControl.ID=this.ID+"_image";
            imageControl.ImageUrl="~/DrawImage.aspx";
            UnitConverter uc = new UnitConverter();
            
            
             
            //imageControl.Width = this.Width;
            //imageControl.Height = this.Height;
            Controls.Add(imageControl);
            
            //int pixw = Convert.ToInt32(this.Width.Value);
            //int pixh = Convert.ToInt32(this.Height.Value);
            //Console.WriteLine("w=" + this.Width.Value + ";h=" + this.Height.Value);
        }

        public Unit Width { 
            get { return imageControl.Width; }
            set { imageControl.Width = value; }
        }
        public Unit Height {
            get { return imageControl.Height; }
            set { imageControl.Height = value; }
        }

        public string ImageKey
        {
            get;
            set;
        }


        
    }
}